import {ref} from "vue";
import {NodeElement} from "./components/hada-canvas-poster/types";
import {saveHistory} from "./nodeElementOperation";

export const modes = ref([ 'scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'heightFix', 'zoomCenter', 'minZoomCenter' ,'center','top','bottom','left','right','top Left','top Right','bottom Left','bottom Right']);




export function dynamicLocationSwitch(node: NodeElement,draw : Function){
    if(!node.css.dynamicLocation){
        node.css.dynamicLocation = {
            offset:{
                top:0,
                left:0
            },
            direction: 'right'
        };
    }else{
        node.css.dynamicLocation = null;
    }
    saveHistory('开关动态定位');
}
